Teach KML geocache writer about entities in GC "number".
authorrobertl <robertl>
Sun, 1 Jun 2008 20:21:34 +0000 (20:21 +0000)
committerrobertl <robertl>
Sun, 1 Jun 2008 20:21:34 +0000 (20:21 +0000)
kml.c

diff --git a/kml.c b/kml.c
index bea0fd24876a1569c11baae6a65df67bf56dccb0..c72c34a426be9781925b4eee3454b216f0bae8e7 100644 (file)
--- a/kml.c
+++ b/kml.c
@@ -859,9 +859,14 @@ static void kml_geocache_pr(const waypoint *waypointp)
        kml_write_xml(-1, "</Style>\n");
 
        kml_write_xml(1, "<ExtendedData>\n");
-       kml_write_xml(0, "<Data name=\"gc_num\"><value>%s</value></Data>\n", waypointp->shortname);
 
-       if(waypointp->url_link_text) {
+       if (waypointp->shortname) {
+               p = xml_entitize(waypointp->shortname);
+               kml_write_xml(0, "<Data name=\"gc_num\"><value>%s</value></Data>\n", p);
+               xfree(p);
+       }
+
+       if (waypointp->url_link_text) {
                p = xml_entitize(waypointp->url_link_text);
                kml_write_xml(0, "<Data name=\"gc_name\"><value>%s</value></Data>\n", p);
                xfree(p);